/-app
/-docs
/-files
/-imports
/-persistence
/-typings ...
codemirror.addons.d.ts
codemirror.d.ts
knockout.d.ts
websql.d.ts
zip.d.ts
errors.js
functions.ts
index.html
try.js
114
    off(completion: showHint.CompletionResult, eventName: 'select', handler: (instance: showHint.CompletionResult, completion: showHint.Completion, element: HTMLElement) => void);
29
  }
30
​
31
  module showHint {
32
    
33
    interface Options {
34
      
35
      /**
36
       * A hinting function. It is possible to set the async property on a hinting function to true,
37
       * in which case it will be called with arguments (cm, callback, ?options),
38
       * and the completion interface will only be popped up when the hinting function calls the callback,
39
       * passing it the object holding the completions.
40
       */
41
      hint: Function;
42
​
43
      /**
44
       * Determines whether, when only a single completion is available, it is completed without showing the dialog.
45
       * Defaults to true.
46
       */
47
      completeSingle?: boolean;
48
​
49
      /**
50
       * Whether the pop - up should be horizontally aligned with the start of the word (true, default),
51
       * or with the cursor (false).
52
       */
53
      alignWithWord?: boolean;
54
​
55
      /**
56
       * When enabled (which is the default), the pop - up will close when the editor is unfocused.
57
       */
58
      closeOnUnfocus?: boolean;
59
​
60
      /**
61
       * Allows you to provide a custom key map of keys to be active when the pop - up is active.
62
       * The handlers will be called with an extra argument, a handle to the completion menu,
63
       * which has moveFocus(n), setFocus(n), pick(), and close() methods (see the source for details),
64
       * that can be used to change the focused element, pick the current element or close the menu.
65
       * Additionnaly menuSize() can give you access to the size of the current dropdown menu,
66
       * length give you the number of availlable completions,
67
       * and data give you full access to the completion returned by the hinting function.
68
       */
69
      customKeys?: any;
70
​
71
      /**
72
       * Like customKeys above, but the bindings will be added to the set of default bindings,
73
       * instead of replacing them.
74
       */
75
      extraKeys?: any;
76
​
77
    }
78
      
79
    interface CompletionResult {
80
      list: Completion[];
81
      from: CodeMirror.Pos;
82
      to: CodeMirror.Pos;
83
    }
84
​
85
    interface Completion {
86
      
87
      /** The completion text. This is the only required property. */
88
      text: string;
89
​
90
      /** The text that should be displayed in the menu. */
91
      displayText?: string;
92
​
93
      /** A CSS class name to apply to the completion's line in the menu. */
94
      className?: string;
95
​
96
      /** A method used to create the DOM structure for showing the completion
97
       * by appending it to its first argument. */
98
      render?: (element: HTMLElement, self, data) => void;
99
​
100
      /** A method used to actually apply the completion, instead of the default behavior. */
101
      hint?: (cm: CodeMirror, self, data) => void;
102
​
103
      /** Optional from position that will be used by pick()
104
       * instead of the global one passed with the full list of completions. */
105
      from?: CodeMirror.Pos;
106
​
107
      /** Optional to position that will be used by pick() instead of the global one
108
       * passed with the full list of completions. */
109
      to?: CodeMirror.Pos;
110
​
111
    }
112
    
113
  }
114
}
113:1